﻿//#define DEBUG
//#define DEBUG_FRMREMIND
#undef DEBUG
//#define DEBUG_TODAY_TASK
//#define DEBUG_ADD_TASK
//#define DEBUG_SEND_EMAIL

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using EasyStudy.Logic;
using EasyStudy.Logic.Remind;
using EasyStudy.Logic.Email;
using System.IO;
using EasyStudy.tools;


namespace EasyStudy
{
    public static class Program
    {
        //public static Sunisoft.IrisSkin.SkinEngine skinEngine = 
        //    new Sunisoft.IrisSkin.SkinEngine();
        public static string exeDir = 
            System.AppDomain.CurrentDomain.BaseDirectory;

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#if DEBUG
            /*
            List<long> circles = EasyStudy.Logic.Time.TimeMgr.GetTaskCircle();

            int index = 1;
            foreach(long l in circles) 
            {
                Console.WriteLine(index + ":" + l + "s");
                ++index;
            }
            */

            EasyStudy.Logic.EbbTaskMgr ebbTaskMgr = new Logic.EbbTaskMgr();
            EbbinghausTask task = ebbTaskMgr.CreateAEbbTask("test");
            // 添加一个艾宾浩斯任务
            //EbbTaskDBMgr.AddAEbbTaskToDB(task);
            // 获取今天的所有任务
            //foreach (EbbinghausTask taskToday in EbbTaskDBMgr.GetTodayTasks())
            //{
            //    Console.WriteLine(taskToday.ToString());
            //}

            RemindCheck checker = new RemindCheck();
            checker.Check();
#elif DEBUG_TODAY_TASK
            Application.Run(new UI.FrmShowTodayTasks());
#elif DEBUG_FRMREMIND
            Application.Run(new UI.FrmRemind());
#elif DEBUG_ADD_TASK
            Application.Run(new UI.FrmAddTask());
#elif DEBUG_SEND_EMAIL
            EmailSender emailSender = new EmailSender();
            emailSender.EmailBody = "this is a test";
            emailSender.SendMail("This is a test", @"ChinaPoison@163.com", "393618835@qq.com", "");
            //emailSender.SendMail();
            System.Console.WriteLine("Send successfully!");
#else
            //skinEngine.SkinFile = exeDir + "Skins" + Path.DirectorySeparatorChar
            //    + "MacOS" + Path.DirectorySeparatorChar
            //    + "MacOS.ssk";
            Control.CheckForIllegalCrossThreadCalls = false;
            Application.Run(new UI.FrmSimple());
            //Application.Run(new UI.FrmDataStatistics());
#endif
        }
    }
}
